<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableBooth class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableBooth object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableBoothMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableBooth $TableBooth the actual TableBooth data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $UserIdControl
	 * property-read QLabel $UserIdLabel
	 * property QIntegerTextBox $CategoryIdControl
	 * property-read QLabel $CategoryIdLabel
	 * property QIntegerTextBox $SubcategoryIdControl
	 * property-read QLabel $SubcategoryIdLabel
	 * property QTextBox $ServiceSummaryDescriptionControl
	 * property-read QLabel $ServiceSummaryDescriptionLabel
	 * property QTextBox $ServiceDetailDescriptionControl
	 * property-read QLabel $ServiceDetailDescriptionLabel
	 * property QTextBox $ServicePolicyDescriptionControl
	 * property-read QLabel $ServicePolicyDescriptionLabel
	 * property QDateTimePicker $OpenedDateControl
	 * property-read QLabel $OpenedDateLabel
	 * property QDateTimePicker $ExpireDateControl
	 * property-read QLabel $ExpireDateLabel
	 * property QIntegerTextBox $PortfolioCountControl
	 * property-read QLabel $PortfolioCountLabel
	 * property QIntegerTextBox $StatusControl
	 * property-read QLabel $StatusLabel
	 * property QTextBox $ActiveControl
	 * property-read QLabel $ActiveLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableBoothMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableBooth;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableBooth's individual data fields
		protected $lblId;
		protected $lstUser;
		protected $txtCategoryId;
		protected $txtSubcategoryId;
		protected $txtServiceSummaryDescription;
		protected $txtServiceDetailDescription;
		protected $txtServicePolicyDescription;
		protected $calOpenedDate;
		protected $calExpireDate;
		protected $txtPortfolioCount;
		protected $txtStatus;
		protected $txtActive;

		// Controls that allow the viewing of TableBooth's individual data fields
		protected $lblUserId;
		protected $lblCategoryId;
		protected $lblSubcategoryId;
		protected $lblServiceSummaryDescription;
		protected $lblServiceDetailDescription;
		protected $lblServicePolicyDescription;
		protected $lblOpenedDate;
		protected $lblExpireDate;
		protected $lblPortfolioCount;
		protected $lblStatus;
		protected $lblActive;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableBoothMetaControl to edit a single TableBooth object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableBooth object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBoothMetaControl
		 * @param TableBooth $objTableBooth new or existing TableBooth object
		 */
		 public function __construct($objParentObject, TableBooth $objTableBooth) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableBoothMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableBooth object
			$this->objTableBooth = $objTableBooth;

			// Figure out if we're Editing or Creating New
			if ($this->objTableBooth->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBoothMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableBooth object creation - defaults to CreateOrEdit
 		 * @return TableBoothMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableBooth = TableBooth::Load($intId);

				// TableBooth was found -- return it!
				if ($objTableBooth)
					return new TableBoothMetaControl($objParentObject, $objTableBooth);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableBooth object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableBoothMetaControl($objParentObject, new TableBooth());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBoothMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableBooth object creation - defaults to CreateOrEdit
		 * @return TableBoothMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableBoothMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBoothMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableBooth object creation - defaults to CreateOrEdit
		 * @return TableBoothMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableBoothMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableBooth->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstUser
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUser_Create($strControlId = null) {
			$this->lstUser = new QListBox($this->objParentObject, $strControlId);
			$this->lstUser->Name = QApplication::Translate('User');
			$this->lstUser->Required = true;
			if (!$this->blnEditMode)
				$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserArray = TableUserProject::LoadAll();
			if ($objUserArray) foreach ($objUserArray as $objUser) {
				$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
				if (($this->objTableBooth->User) && ($this->objTableBooth->User->Id == $objUser->Id))
					$objListItem->Selected = true;
				$this->lstUser->AddItem($objListItem);
			}
			return $this->lstUser;
		}

		/**
		 * Create and setup QLabel lblUserId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserId_Create($strControlId = null) {
			$this->lblUserId = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserId->Name = QApplication::Translate('User');
			$this->lblUserId->Text = ($this->objTableBooth->User) ? $this->objTableBooth->User->__toString() : null;
			$this->lblUserId->Required = true;
			return $this->lblUserId;
		}

		/**
		 * Create and setup QIntegerTextBox txtCategoryId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtCategoryId_Create($strControlId = null) {
			$this->txtCategoryId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtCategoryId->Name = QApplication::Translate('Category Id');
			$this->txtCategoryId->Text = $this->objTableBooth->CategoryId;
			return $this->txtCategoryId;
		}

		/**
		 * Create and setup QLabel lblCategoryId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblCategoryId_Create($strControlId = null, $strFormat = null) {
			$this->lblCategoryId = new QLabel($this->objParentObject, $strControlId);
			$this->lblCategoryId->Name = QApplication::Translate('Category Id');
			$this->lblCategoryId->Text = $this->objTableBooth->CategoryId;
			$this->lblCategoryId->Format = $strFormat;
			return $this->lblCategoryId;
		}

		/**
		 * Create and setup QIntegerTextBox txtSubcategoryId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtSubcategoryId_Create($strControlId = null) {
			$this->txtSubcategoryId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtSubcategoryId->Name = QApplication::Translate('Subcategory Id');
			$this->txtSubcategoryId->Text = $this->objTableBooth->SubcategoryId;
			return $this->txtSubcategoryId;
		}

		/**
		 * Create and setup QLabel lblSubcategoryId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblSubcategoryId_Create($strControlId = null, $strFormat = null) {
			$this->lblSubcategoryId = new QLabel($this->objParentObject, $strControlId);
			$this->lblSubcategoryId->Name = QApplication::Translate('Subcategory Id');
			$this->lblSubcategoryId->Text = $this->objTableBooth->SubcategoryId;
			$this->lblSubcategoryId->Format = $strFormat;
			return $this->lblSubcategoryId;
		}

		/**
		 * Create and setup QTextBox txtServiceSummaryDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtServiceSummaryDescription_Create($strControlId = null) {
			$this->txtServiceSummaryDescription = new QTextBox($this->objParentObject, $strControlId);
			$this->txtServiceSummaryDescription->Name = QApplication::Translate('Service Summary Description');
			$this->txtServiceSummaryDescription->Text = $this->objTableBooth->ServiceSummaryDescription;
			$this->txtServiceSummaryDescription->TextMode = QTextMode::MultiLine;
			return $this->txtServiceSummaryDescription;
		}

		/**
		 * Create and setup QLabel lblServiceSummaryDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblServiceSummaryDescription_Create($strControlId = null) {
			$this->lblServiceSummaryDescription = new QLabel($this->objParentObject, $strControlId);
			$this->lblServiceSummaryDescription->Name = QApplication::Translate('Service Summary Description');
			$this->lblServiceSummaryDescription->Text = $this->objTableBooth->ServiceSummaryDescription;
			return $this->lblServiceSummaryDescription;
		}

		/**
		 * Create and setup QTextBox txtServiceDetailDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtServiceDetailDescription_Create($strControlId = null) {
			$this->txtServiceDetailDescription = new QTextBox($this->objParentObject, $strControlId);
			$this->txtServiceDetailDescription->Name = QApplication::Translate('Service Detail Description');
			$this->txtServiceDetailDescription->Text = $this->objTableBooth->ServiceDetailDescription;
			$this->txtServiceDetailDescription->TextMode = QTextMode::MultiLine;
			return $this->txtServiceDetailDescription;
		}

		/**
		 * Create and setup QLabel lblServiceDetailDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblServiceDetailDescription_Create($strControlId = null) {
			$this->lblServiceDetailDescription = new QLabel($this->objParentObject, $strControlId);
			$this->lblServiceDetailDescription->Name = QApplication::Translate('Service Detail Description');
			$this->lblServiceDetailDescription->Text = $this->objTableBooth->ServiceDetailDescription;
			return $this->lblServiceDetailDescription;
		}

		/**
		 * Create and setup QTextBox txtServicePolicyDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtServicePolicyDescription_Create($strControlId = null) {
			$this->txtServicePolicyDescription = new QTextBox($this->objParentObject, $strControlId);
			$this->txtServicePolicyDescription->Name = QApplication::Translate('Service Policy Description');
			$this->txtServicePolicyDescription->Text = $this->objTableBooth->ServicePolicyDescription;
			$this->txtServicePolicyDescription->TextMode = QTextMode::MultiLine;
			return $this->txtServicePolicyDescription;
		}

		/**
		 * Create and setup QLabel lblServicePolicyDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblServicePolicyDescription_Create($strControlId = null) {
			$this->lblServicePolicyDescription = new QLabel($this->objParentObject, $strControlId);
			$this->lblServicePolicyDescription->Name = QApplication::Translate('Service Policy Description');
			$this->lblServicePolicyDescription->Text = $this->objTableBooth->ServicePolicyDescription;
			return $this->lblServicePolicyDescription;
		}

		/**
		 * Create and setup QDateTimePicker calOpenedDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calOpenedDate_Create($strControlId = null) {
			$this->calOpenedDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calOpenedDate->Name = QApplication::Translate('Opened Date');
			$this->calOpenedDate->DateTime = $this->objTableBooth->OpenedDate;
			$this->calOpenedDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calOpenedDate;
		}

		/**
		 * Create and setup QLabel lblOpenedDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblOpenedDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblOpenedDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblOpenedDate->Name = QApplication::Translate('Opened Date');
			$this->strOpenedDateDateTimeFormat = $strDateTimeFormat;
			$this->lblOpenedDate->Text = sprintf($this->objTableBooth->OpenedDate) ? $this->objTableBooth->OpenedDate->__toString($this->strOpenedDateDateTimeFormat) : null;
			return $this->lblOpenedDate;
		}

		protected $strOpenedDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calExpireDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calExpireDate_Create($strControlId = null) {
			$this->calExpireDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calExpireDate->Name = QApplication::Translate('Expire Date');
			$this->calExpireDate->DateTime = $this->objTableBooth->ExpireDate;
			$this->calExpireDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calExpireDate;
		}

		/**
		 * Create and setup QLabel lblExpireDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblExpireDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblExpireDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblExpireDate->Name = QApplication::Translate('Expire Date');
			$this->strExpireDateDateTimeFormat = $strDateTimeFormat;
			$this->lblExpireDate->Text = sprintf($this->objTableBooth->ExpireDate) ? $this->objTableBooth->ExpireDate->__toString($this->strExpireDateDateTimeFormat) : null;
			return $this->lblExpireDate;
		}

		protected $strExpireDateDateTimeFormat;


		/**
		 * Create and setup QIntegerTextBox txtPortfolioCount
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtPortfolioCount_Create($strControlId = null) {
			$this->txtPortfolioCount = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtPortfolioCount->Name = QApplication::Translate('Portfolio Count');
			$this->txtPortfolioCount->Text = $this->objTableBooth->PortfolioCount;
			return $this->txtPortfolioCount;
		}

		/**
		 * Create and setup QLabel lblPortfolioCount
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblPortfolioCount_Create($strControlId = null, $strFormat = null) {
			$this->lblPortfolioCount = new QLabel($this->objParentObject, $strControlId);
			$this->lblPortfolioCount->Name = QApplication::Translate('Portfolio Count');
			$this->lblPortfolioCount->Text = $this->objTableBooth->PortfolioCount;
			$this->lblPortfolioCount->Format = $strFormat;
			return $this->lblPortfolioCount;
		}

		/**
		 * Create and setup QIntegerTextBox txtStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtStatus_Create($strControlId = null) {
			$this->txtStatus = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtStatus->Name = QApplication::Translate('Status');
			$this->txtStatus->Text = $this->objTableBooth->Status;
			$this->txtStatus->Required = true;
			return $this->txtStatus;
		}

		/**
		 * Create and setup QLabel lblStatus
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblStatus_Create($strControlId = null, $strFormat = null) {
			$this->lblStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblStatus->Name = QApplication::Translate('Status');
			$this->lblStatus->Text = $this->objTableBooth->Status;
			$this->lblStatus->Required = true;
			$this->lblStatus->Format = $strFormat;
			return $this->lblStatus;
		}

		/**
		 * Create and setup QTextBox txtActive
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtActive_Create($strControlId = null) {
			$this->txtActive = new QTextBox($this->objParentObject, $strControlId);
			$this->txtActive->Name = QApplication::Translate('Active');
			$this->txtActive->Text = $this->objTableBooth->Active;
			$this->txtActive->Required = true;
			$this->txtActive->MaxLength = TableBooth::ActiveMaxLength;
			return $this->txtActive;
		}

		/**
		 * Create and setup QLabel lblActive
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblActive_Create($strControlId = null) {
			$this->lblActive = new QLabel($this->objParentObject, $strControlId);
			$this->lblActive->Name = QApplication::Translate('Active');
			$this->lblActive->Text = $this->objTableBooth->Active;
			$this->lblActive->Required = true;
			return $this->lblActive;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableBooth object.
		 * @param boolean $blnReload reload TableBooth from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableBooth->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableBooth->Id;

			if ($this->lstUser) {
					$this->lstUser->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserArray = TableUserProject::LoadAll();
				if ($objUserArray) foreach ($objUserArray as $objUser) {
					$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
					if (($this->objTableBooth->User) && ($this->objTableBooth->User->Id == $objUser->Id))
						$objListItem->Selected = true;
					$this->lstUser->AddItem($objListItem);
				}
			}
			if ($this->lblUserId) $this->lblUserId->Text = ($this->objTableBooth->User) ? $this->objTableBooth->User->__toString() : null;

			if ($this->txtCategoryId) $this->txtCategoryId->Text = $this->objTableBooth->CategoryId;
			if ($this->lblCategoryId) $this->lblCategoryId->Text = $this->objTableBooth->CategoryId;

			if ($this->txtSubcategoryId) $this->txtSubcategoryId->Text = $this->objTableBooth->SubcategoryId;
			if ($this->lblSubcategoryId) $this->lblSubcategoryId->Text = $this->objTableBooth->SubcategoryId;

			if ($this->txtServiceSummaryDescription) $this->txtServiceSummaryDescription->Text = $this->objTableBooth->ServiceSummaryDescription;
			if ($this->lblServiceSummaryDescription) $this->lblServiceSummaryDescription->Text = $this->objTableBooth->ServiceSummaryDescription;

			if ($this->txtServiceDetailDescription) $this->txtServiceDetailDescription->Text = $this->objTableBooth->ServiceDetailDescription;
			if ($this->lblServiceDetailDescription) $this->lblServiceDetailDescription->Text = $this->objTableBooth->ServiceDetailDescription;

			if ($this->txtServicePolicyDescription) $this->txtServicePolicyDescription->Text = $this->objTableBooth->ServicePolicyDescription;
			if ($this->lblServicePolicyDescription) $this->lblServicePolicyDescription->Text = $this->objTableBooth->ServicePolicyDescription;

			if ($this->calOpenedDate) $this->calOpenedDate->DateTime = $this->objTableBooth->OpenedDate;
			if ($this->lblOpenedDate) $this->lblOpenedDate->Text = sprintf($this->objTableBooth->OpenedDate) ? $this->objTableBooth->OpenedDate->__toString($this->strOpenedDateDateTimeFormat) : null;

			if ($this->calExpireDate) $this->calExpireDate->DateTime = $this->objTableBooth->ExpireDate;
			if ($this->lblExpireDate) $this->lblExpireDate->Text = sprintf($this->objTableBooth->ExpireDate) ? $this->objTableBooth->ExpireDate->__toString($this->strExpireDateDateTimeFormat) : null;

			if ($this->txtPortfolioCount) $this->txtPortfolioCount->Text = $this->objTableBooth->PortfolioCount;
			if ($this->lblPortfolioCount) $this->lblPortfolioCount->Text = $this->objTableBooth->PortfolioCount;

			if ($this->txtStatus) $this->txtStatus->Text = $this->objTableBooth->Status;
			if ($this->lblStatus) $this->lblStatus->Text = $this->objTableBooth->Status;

			if ($this->txtActive) $this->txtActive->Text = $this->objTableBooth->Active;
			if ($this->lblActive) $this->lblActive->Text = $this->objTableBooth->Active;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEBOOTH OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableBooth instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableBooth() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstUser) $this->objTableBooth->UserId = $this->lstUser->SelectedValue;
				if ($this->txtCategoryId) $this->objTableBooth->CategoryId = $this->txtCategoryId->Text;
				if ($this->txtSubcategoryId) $this->objTableBooth->SubcategoryId = $this->txtSubcategoryId->Text;
				if ($this->txtServiceSummaryDescription) $this->objTableBooth->ServiceSummaryDescription = $this->txtServiceSummaryDescription->Text;
				if ($this->txtServiceDetailDescription) $this->objTableBooth->ServiceDetailDescription = $this->txtServiceDetailDescription->Text;
				if ($this->txtServicePolicyDescription) $this->objTableBooth->ServicePolicyDescription = $this->txtServicePolicyDescription->Text;
				if ($this->calOpenedDate) $this->objTableBooth->OpenedDate = $this->calOpenedDate->DateTime;
				if ($this->calExpireDate) $this->objTableBooth->ExpireDate = $this->calExpireDate->DateTime;
				if ($this->txtPortfolioCount) $this->objTableBooth->PortfolioCount = $this->txtPortfolioCount->Text;
				if ($this->txtStatus) $this->objTableBooth->Status = $this->txtStatus->Text;
				if ($this->txtActive) $this->objTableBooth->Active = $this->txtActive->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableBooth object
				$this->objTableBooth->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableBooth instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableBooth() {
			$this->objTableBooth->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableBooth': return $this->objTableBooth;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableBooth fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'UserIdControl':
					if (!$this->lstUser) return $this->lstUser_Create();
					return $this->lstUser;
				case 'UserIdLabel':
					if (!$this->lblUserId) return $this->lblUserId_Create();
					return $this->lblUserId;
				case 'CategoryIdControl':
					if (!$this->txtCategoryId) return $this->txtCategoryId_Create();
					return $this->txtCategoryId;
				case 'CategoryIdLabel':
					if (!$this->lblCategoryId) return $this->lblCategoryId_Create();
					return $this->lblCategoryId;
				case 'SubcategoryIdControl':
					if (!$this->txtSubcategoryId) return $this->txtSubcategoryId_Create();
					return $this->txtSubcategoryId;
				case 'SubcategoryIdLabel':
					if (!$this->lblSubcategoryId) return $this->lblSubcategoryId_Create();
					return $this->lblSubcategoryId;
				case 'ServiceSummaryDescriptionControl':
					if (!$this->txtServiceSummaryDescription) return $this->txtServiceSummaryDescription_Create();
					return $this->txtServiceSummaryDescription;
				case 'ServiceSummaryDescriptionLabel':
					if (!$this->lblServiceSummaryDescription) return $this->lblServiceSummaryDescription_Create();
					return $this->lblServiceSummaryDescription;
				case 'ServiceDetailDescriptionControl':
					if (!$this->txtServiceDetailDescription) return $this->txtServiceDetailDescription_Create();
					return $this->txtServiceDetailDescription;
				case 'ServiceDetailDescriptionLabel':
					if (!$this->lblServiceDetailDescription) return $this->lblServiceDetailDescription_Create();
					return $this->lblServiceDetailDescription;
				case 'ServicePolicyDescriptionControl':
					if (!$this->txtServicePolicyDescription) return $this->txtServicePolicyDescription_Create();
					return $this->txtServicePolicyDescription;
				case 'ServicePolicyDescriptionLabel':
					if (!$this->lblServicePolicyDescription) return $this->lblServicePolicyDescription_Create();
					return $this->lblServicePolicyDescription;
				case 'OpenedDateControl':
					if (!$this->calOpenedDate) return $this->calOpenedDate_Create();
					return $this->calOpenedDate;
				case 'OpenedDateLabel':
					if (!$this->lblOpenedDate) return $this->lblOpenedDate_Create();
					return $this->lblOpenedDate;
				case 'ExpireDateControl':
					if (!$this->calExpireDate) return $this->calExpireDate_Create();
					return $this->calExpireDate;
				case 'ExpireDateLabel':
					if (!$this->lblExpireDate) return $this->lblExpireDate_Create();
					return $this->lblExpireDate;
				case 'PortfolioCountControl':
					if (!$this->txtPortfolioCount) return $this->txtPortfolioCount_Create();
					return $this->txtPortfolioCount;
				case 'PortfolioCountLabel':
					if (!$this->lblPortfolioCount) return $this->lblPortfolioCount_Create();
					return $this->lblPortfolioCount;
				case 'StatusControl':
					if (!$this->txtStatus) return $this->txtStatus_Create();
					return $this->txtStatus;
				case 'StatusLabel':
					if (!$this->lblStatus) return $this->lblStatus_Create();
					return $this->lblStatus;
				case 'ActiveControl':
					if (!$this->txtActive) return $this->txtActive_Create();
					return $this->txtActive;
				case 'ActiveLabel':
					if (!$this->lblActive) return $this->lblActive_Create();
					return $this->lblActive;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableBooth fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'UserIdControl':
						return ($this->lstUser = QType::Cast($mixValue, 'QControl'));
					case 'CategoryIdControl':
						return ($this->txtCategoryId = QType::Cast($mixValue, 'QControl'));
					case 'SubcategoryIdControl':
						return ($this->txtSubcategoryId = QType::Cast($mixValue, 'QControl'));
					case 'ServiceSummaryDescriptionControl':
						return ($this->txtServiceSummaryDescription = QType::Cast($mixValue, 'QControl'));
					case 'ServiceDetailDescriptionControl':
						return ($this->txtServiceDetailDescription = QType::Cast($mixValue, 'QControl'));
					case 'ServicePolicyDescriptionControl':
						return ($this->txtServicePolicyDescription = QType::Cast($mixValue, 'QControl'));
					case 'OpenedDateControl':
						return ($this->calOpenedDate = QType::Cast($mixValue, 'QControl'));
					case 'ExpireDateControl':
						return ($this->calExpireDate = QType::Cast($mixValue, 'QControl'));
					case 'PortfolioCountControl':
						return ($this->txtPortfolioCount = QType::Cast($mixValue, 'QControl'));
					case 'StatusControl':
						return ($this->txtStatus = QType::Cast($mixValue, 'QControl'));
					case 'ActiveControl':
						return ($this->txtActive = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>